package cn.thoughtworks.school;

import cn.thoughtworks.school.services.TopicDiffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/api/diff")
public class TopicDiffController {
    @Autowired
    private TopicDiffService topicDiffService;

    @PostMapping("topics")
    public ResponseEntity updateTopicNotification(@RequestBody Map data) {
        topicDiffService.updateTopicNotification(data);
        return new ResponseEntity(HttpStatus.CREATED);
    }
}
